package com.gqz.equip.app.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_INTERFACE_CODE")
public class TEnInterfaceCodeEntity implements Serializable {

    /**
     * id
     */
    @TableId(value = "ID")
    private String id;

    /**
     * 编号
     */
    @TableField(value = "CODE")
    private String code;

    /**
     * 名称
     */
    @TableField(value = "VALUE")
    private String value;

    /**
     * 类型
     */
    @TableField(value = "TYPE")
    private String type;

    /**
     * 是否可用
     */
    @TableField(value = "ISACTIVE")
    private String isactive;

    /**
     * 类型名称
     */
    @TableField(value = "TYPE_NAME")
    private String typeName;

    /**
     * 排序
     */
    @TableField(value = "ORDER_NO")
    private String orderNo;

    /**
     * start这个是必须要的动态条件集合start   start
     */
    private static Map<String, SFunction<TEnInterfaceCodeEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("id", TEnInterfaceCodeEntity::getId);
        map.put("code", TEnInterfaceCodeEntity::getCode);
        map.put("value", TEnInterfaceCodeEntity::getValue);
        map.put("type", TEnInterfaceCodeEntity::getType);
        map.put("isactive", TEnInterfaceCodeEntity::getIsactive);
        map.put("typeName", TEnInterfaceCodeEntity::getTypeName);
        map.put("orderNo", TEnInterfaceCodeEntity::getOrderNo);

    }

    public static SFunction<TEnInterfaceCodeEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end这个是必须要的动态条件集合end   end */


}
